package com.example.security.vo;

import com.example.security.entity.SysUser;
import lombok.Builder;
import lombok.Data;
import java.util.Set;
import java.util.HashSet;

/**
 * 登录响应对象
 */
@Data
@Builder
public class LoginResponse {
    /**
     * JWT token
     */
    private String token;
    
    /**
     * 用户信息
     */
    private SysUser user;
    
    /**
     * 权限列表
     */
    private Set<String> permissions;

    /**
     * 用户类型
     */
    private String userType;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 过期时间
     */
    private Long expireTime;

    public LoginResponse(String token) {
        this.token = token;
    }

    public LoginResponse(String token, SysUser user, Set<String> permissions) {
        this.token = token;
        this.user = user;
        this.permissions = permissions;
    }

    public LoginResponse(String token, SysUser user, Set<String> permissions, 
                        String userType, String tenantId, Long expireTime) {
        this.token = token;
        this.user = user;
        this.permissions = permissions != null ? permissions : new HashSet<>();
        this.userType = userType;
        this.tenantId = tenantId;
        this.expireTime = expireTime;
    }
} 